﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lm.Common.Auth.Server
{
    public class RequestFactory:Lm.Common.Net.IRequestHandler
    {
        #region IRequestHandler 成员

        public object Handle(object request)
        {
            var className = "Lm.Common.Auth.Server.Services." +
                request.GetType().Namespace.Split('.').Last()
                + "Service";
            var service = (Lm.Common.Net.IRequestHandler)System.Reflection.Assembly.GetExecutingAssembly()
                .CreateInstance(className);
            return service.Handle(request);
        }

        #endregion
    }
}
